package hk.com.fwd.web.rest;

import com.github.pagehelper.PageInfo;
import hk.com.fwd.biz.OriginalBo;
import hk.com.fwd.biz.exception.DmsException;
import hk.com.fwd.model.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
public class OriginalRestController extends BaseRestController {


    @Autowired
    private OriginalBo originalBo;


    @RequestMapping(value = "/original/searrchByHelper", method = RequestMethod.POST)
    public PageInfo searchOriginalByHelper(@RequestBody PageBean<OriginalDTO> pageBean) throws DmsException {
        return originalBo.searchOriginalByHelper(pageBean);
    }

    @RequestMapping(value = "/original/save", method = RequestMethod.POST)
    public int saveOriginal(@RequestBody OriginalDTO obj) throws DmsException {
        return originalBo.saveOriginal(obj);
    }

    @RequestMapping(value = "/original/delete", method = RequestMethod.POST)
    public int deleteOriginal(@RequestBody List<OriginalDTO> list) throws DmsException {
        return originalBo.deleteOriginal(list);
    }



}
